import asyncio

import click

from tree_rag.utils.parse_data_from_excel import prapare_data_from_excel


@click.command()
@click.argument("sheet")
@click.option("--dataset-id", help="dataset id")
@click.option("--tenant-id", help="tenant id")
@click.option("--channel-id", help="channel id")
@click.option("--ktype", default="normal", help="knowledge type, goodcase or badcase")
def main(sheet, dataset_id, tenant_id, channel_id, ktype="normal"):
    """Upload datasets from Excel sheet."""
    asyncio.run(
        prapare_data_from_excel(sheet, dataset_id, tenant_id, channel_id, ktype=ktype)
    )


if __name__ == "__main__":
    main()
